<script setup lang="ts">
import { inject, type Ref, ref } from "vue";

const a = inject<Ref<number>>("info", ref(0));
const updateTotalCount = inject("updateTotalCount", (num: number) => {});
</script>

<template>
  <h3>{{ a }}</h3>
  <button @click="a++">后代修改</button>
  <button @click="updateTotalCount(10)">调用函数</button>
</template>
